1. Field of the Invention
The present invention relates to a vector processor for processing a computation of a matrix having a great number of elements or the like at a high speed.
2. Description of the Prior Art
A vector processor has been utilized to rapidly process calculations, for example, of a matrix including a large number of elements which are frequently required in scientific applications. A configuration of a vector processor has been disclosed in, for example, U.S. Pat. Nos. 4,128,880 and 4,433,394.
A program written in the FORTRAN language as follows can be executed at a high speed by using a vector operation.
______________________________________ DO 10 i = 1, N A(i) = B(i) + C(i) 10 CONTINUE ______________________________________
That is, the result of an addition of each vector element (B(i), C(i)) is stored as vector A (A(i), i=1, N), where vectors B and C are (B(i), i=1, N) and (C(i), i=1, N), respectively. In this fashion, the vector processor can rapidly process a computation between vector elements based on a vector processing scheme.
Assume that the above-mentioned FORTRAN program is to be changed as follows.
______________________________________ DO 10 i = 1, N - 20 A(i) = B(i) + C(i) 10 CONTINUE DO 20 i = 1, 20 J = i + N - 20 A(J) = B(J) - C(J) 20 CONTINUE ______________________________________
In this case, each element of vectors B(1) to B(N-20) and each element of vectors C(1) to C(N-20) are added, whereas each element of vectors C(N-19) to C(N) is subtracted from each element of vectors B(N-19) to B(N), and the results must be stored as the vector A.
If the prior art vector processor is used to execute the vector processing, only one type of operator, such as addition or subtraction can be designated for processing one or each vector, and hence the vector processing must be executed twice, which has been a bottleneck for a high-speed processing.